package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.dto.CategoryDTO;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface CategoryMapper extends BaseMapper<Category> {
    //根据父类目id，查询子类目的集合
    @Select("select tc.id,tc.is_parent,tc.name,tc.parent_id,tc.sort from tb_category tc where parent_id = #{pid}")
    List<CategoryDTO> queryCategoriesByParentId(@Param("pid") Long pid);
}
